<?php
	$color_id = $params[2];
	if($_SERVER["REQUEST_METHOD"]=='POST') {
		$title			= strip_tags($_POST['title']);
		$color_code		= strip_tags($_POST['color_code']);
		$sql = "UPDATE `tbl_color` SET `title` = '$title' ,`color_code` = '$color_code' WHERE `color_id` = '$color_id' LIMIT 1;";
		mysql_query($sql);
		redirect('../');
		exit;
	}
	$sql = "SELECT * FROM `tbl_color` WHERE  `color_id` = '$color_id' LIMIT 1";
	$query = mysql_query($sql);
	while($result = mysql_fetch_assoc($query)) {
		$title		= $result['title'];
		$color_code	= $result['color_code'];
	}
	mysql_free_result($query);
?>